<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <%@ include file="/common/pre/header.jsp" %>
    <script type="text/javascript" src="${ctx}/statics/js/common/n_nav.js"></script>
    <script src="${ctx}/statics/js/cart/cart.js"></script>
    <title>易买网</title>
</head>
<body>
<!--Begin Header Begin-->
<div id="searchBar">
    <%@ include file="/common/pre/searchBar.jsp" %>
</div>
<!--End Header End-->
<!--Begin Menu Begin-->
<div class="menu_bg">
    <div class="menu">
        <!--Begin 商品分类详情 Begin-->
        <%@ include file="/common/pre/categoryBar.jsp" %>
        <!--End 商品分类详情 End-->
    </div>
</div>
<!--End Menu End-->
<div class="i_bg">
    <!--Begin 筛选条件 Begin-->
    <!--End 筛选条件 End-->
    <div class="content mar_20">
        <div id="favoriteList">
        </div>
        <div class="l_list">
            <div class="list_t">
                <span class="fr">共发现${pageUtil.totalCount}件</span>
            </div>
            <div class="list_c">
                <ul class="cate_list">
                	<c:forEach items="${pageUtil.list }" var="product">
	                    <li>
	                    	<div class="img"><a href="${ctx }/product?action=queryDetails&id=${product.id}"><img src="${ctx}/files/${product.fileName}" width="210" height="185"></a></div>
	                        <div class="price">
	                            <font>￥<span>${product.price }</span></font> &nbsp;
	                        </div>
	                        <div class="name"><a href="#">${product.name }</a></div>
	                        <div class="carbg">
	                        	<a href="#" class="ss">收藏</a>
	                            <a href="#" class="j_car" onclick="addCartByParam(${product.id},1)">加入购物车</a>
	                        </div>
	                    </li>
                    </c:forEach>
                </ul>
                
                <!-- 
                	pager.currentPage 当前页码
                	pager.pageCount  总页数
                 -->
                <div class="pages">
				    <c:if test="${pageUtil.totalPage>=1}">
				      <c:set var="url" value="${ctx}/product?action=queryList&categoryId=${param.categoryId }&categoryLevel=${param.categoryLevel }"></c:set>
				      <a href="${url}&currPage=1" class="p_pre">首页</a>
				        <c:if test="${pageUtil.currPage>1}">
				            <a href="${url}&currPage=${pageUtil.currPage-1}" class="p_pre">上一页</a>
				        </c:if>
				        <c:forEach  var="temp" begin="${pageUtil.currPage>3?currPage-3:1}" end="${pageUtil.totalPage-pageUtil.currPage>3?pageUtil.currPage+3:pageUtil.totalPage}" step="1">
				            <c:if test="${pageUtil.currPage==temp}">
				                <a href="${url}&currPage=${temp}" class="cur">${temp}</a>
				            </c:if>
				            <c:if test="${pageUtil.currPage!=temp}">
				                <a href="${url}&currPage=${temp}">${temp}</a>
				            </c:if>
				        </c:forEach>
				      <c:if test="${pageUtil.currPage<pageUtil.totalPage}">
				         <a href="${url}&currPage=${pageUtil.currPage+1}" class="p_pre">下一页</a>
				      </c:if>
				      <a href="${url}&currPage=${pageUtil.totalPage}" class="p_pre">尾页</a>
				    </c:if>
				    <c:if test="${pageUtil.totalPage==0}">
				        暂无记录
				    </c:if>
				</div>
            </div>
        </div>
    </div>
    <%@ include file="/common/pre/footer.jsp" %>
</div>
</body>
</html>
